<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>
<link type="text/css" rel="stylesheet" href="layui/css/layui.css">
<script type="text/javascript" src="layui/layui.js"></script>
</head>
<body>
        ${msg }
		<form action="ProfileServlet?reqName=selectALL" method="post">
		  姓名:<input type="text" name="name">
		  <button type="submit">提交</button>
		</form>
		<a href="userAdd.jsp">新增用户</a>
<table border="1"> 
  <tr align="center">    
  <td>姓名</td>    
  <td>年龄</td> 
  <td>性别</td> 
  <td>id</td> 
  <td>操作</td>
  </tr> 
  <c:choose> 
   <c:when test="${empty alist }"> 
    <tr align="center">      
    <td colspan="3">没有相关数据</td> 
    </tr> 
   </c:when> 
   <c:otherwise> 
    <c:forEach items="${alist }" var="u"> 
     <tr align="center"> 
      <td>${u.name }</td> 
      <td>${u.age }</td> 
      <td>${u.sex }</td> 
      <td>${u.id }</td> 
      <td>
       <a href="ProfileServlet?reqName=userDetail&id=${u.id}" class="layui-btn">详情</a>
      <a href="ProfileServlet?reqName=userDelete&id=${u.id}" class="layui-btn">
      <i class="layui-icon layui-icon-delete"></i>
      删除</a>
      <a href="ProfileServlet?reqName=updateUser&id=${u.id}" class="layui-btn">
      <i class="layui-icon layui-icon-edit"></i>
      修改</a>
      </td> 
     </tr> 
    </c:forEach> 
   </c:otherwise> 
  </c:choose> 
 </table>
</body>
</html>